/**
 * @file UpdateContactInfoHandler.cs
 * @author Zane Mayo
 * @date 21/5/2009
 */

using System;

namespace MxitAPI {
	
	
	public class UpdateContactInfoHandler : Handler {
		
		private static log4net.ILog log = log4net.LogManager.GetLogger( System.Reflection.MethodBase.GetCurrentMethod().DeclaringType );
		
		private string group;
		private string contactAddress;
		private string nickName;
		
		public UpdateContactInfoHandler() : base( typeof( UpdateContactInfoProtocolMessage ) ) {
		}
		
		// Todo maybe take in the id for the contact instead of the string
		public UpdateContactInfoHandler( string group, string contactAddress, string nickName ) : this() {
			this.group = group;
			this.contactAddress = contactAddress;
			this.nickName = nickName;
			
			log.Debug( "UpdateContactInfoHandler constructed" );
		}
		
		public override ProtocolMessage CreateRequestProtocolMessage ()
		{
			UpdateContactInfoProtocolMessage protocolMessage = new UpdateContactInfoProtocolMessage();
			protocolMessage.Group = group;
			protocolMessage.ContactAddress = contactAddress;
			protocolMessage.NickName = nickName;
			
			log.Debug( "UpdateContactInfoHandler created ProtocolMessage" );
			
			return protocolMessage;
		}
				
		
	}
}
